from django.db import models




class TbBiotechmessage(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    w_no = models.CharField(max_length=40, blank=True, null=True)
    m_no = models.CharField(max_length=40, blank=True, null=True)
    w_name = models.CharField(max_length=40, blank=True, null=True)
    w_ceme = models.CharField(max_length=40, blank=True, null=True)
    w_bran = models.CharField(max_length=40, blank=True, null=True)
    w_diam = models.FloatField(blank=True, null=True)
    w_arc = models.FloatField(blank=True, null=True)
    m_stat = models.CharField(max_length=20, blank=True, null=True)
    engi_id = models.CharField(max_length=10, blank=True, null=True)
    engi_time = models.DateTimeField(blank=True, null=True)
    w_bala = models.FloatField(blank=True, null=True)
    w_rnot1 = models.FloatField(blank=True, null=True)
    t_ver = models.CharField(max_length=40, blank=True, null=True)
    w_rnot2 = models.FloatField(blank=True, null=True)
    g_ct = models.FloatField(blank=True, null=True)
    w_gran = models.CharField(max_length=20, blank=True, null=True)
    w_speed = models.FloatField(blank=True, null=True)
    w_feed = models.FloatField(blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)

    class Meta:
        db_table = 'tb_biotechmessage'


class TbCTypeBody(models.Model):
    c_type = models.ForeignKey('TbCTypeHead', blank=True, null=True)
    type_part = models.CharField(max_length=20, blank=True, null=True)
    size_name = models.CharField(max_length=25, blank=True, null=True)
    size_code = models.CharField(max_length=20, blank=True, null=True)
    g_type = models.CharField(max_length=10, blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)
    context = models.TextField(blank=True, null=True)
    desc1 = models.IntegerField(blank=True, null=True)
    size_picture = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        db_table = 'tb_c_type_body'


class TbCTypeHead(models.Model):
    c_type = models.CharField(max_length=20, blank=True, null=True)

    class Meta:
        db_table = 'tb_c_type_head'


class TbDesignmessage(models.Model):
    t_name = models.CharField(max_length=40)
    t_spec = models.CharField(max_length=20, blank=True, null=True)
    t_type = models.CharField(max_length=10)
    t_diam = models.FloatField(blank=True, null=True)
    t_flen = models.FloatField(blank=True, null=True)
    t_fnum = models.IntegerField(blank=True, null=True)
    t_mmat = models.CharField(max_length=20, blank=True, null=True)
    desi_id = models.CharField(max_length=10, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    desi_time = models.DateTimeField(blank=True, null=True)
    t_conn = models.CharField(max_length=40, blank=True, null=True)
    t_ver = models.CharField(max_length=20, blank=True, null=True)

    class Meta:
        db_table = 'tb_designmessage'


class TbDesignsize(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    d_code = models.CharField(max_length=20, blank=True, null=True)
    g_type = models.CharField(max_length=20, blank=True, null=True)
    g_size = models.FloatField(blank=True, null=True)
    g_otol = models.FloatField(blank=True, null=True)
    g_itol = models.FloatField(blank=True, null=True)
    desi_id = models.CharField(max_length=10, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    desi_time = models.DateTimeField(blank=True, null=True)
    t_ver = models.CharField(max_length=10, blank=True, null=True)
    grindingsite = models.CharField(max_length=50, blank=True, null=True)
    toolt = models.ForeignKey(TbDesignmessage)
    desc1 = models.IntegerField(blank=True, null=True)
    class Meta:
        db_table = 'tb_designsize'


class TbMachine(models.Model):
    site = models.CharField(max_length=4, blank=True, null=True)
    m_type = models.CharField(max_length=40, blank=True, null=True)
    cell_num = models.CharField(max_length=4, blank=True, null=True)
    new_name = models.CharField(max_length=40, blank=True, null=True)
    org = models.CharField(max_length=60, blank=True, null=True)
    org_code = models.CharField(max_length=40, blank=True, null=True)

    class Meta:
        db_table = 'tb_machine'

class TbProductHead(models.Model):
    ct = models.IntegerField(blank=True, null=True)
    me_no = models.IntegerField(blank=True, null=True)
    t_name = models.CharField(max_length=50, blank=True, null=True)
    m_no = models.CharField(max_length=50, blank=True, null=True)
    op_id = models.CharField(max_length=20, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    op_time = models.DateTimeField(blank=True, null=True)
    t_no = models.CharField(max_length=20, blank=True, null=True)
    t_bmta = models.CharField(max_length=20, blank=True, null=True)
    t_rnot = models.CharField(max_length=20, blank=True, null=True)
    t_ver = models.CharField(max_length=40, blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)
    toolt = models.ForeignKey(TbDesignmessage)
    m_stat= models.CharField(max_length=10, blank=True, null=True)
    uuid = models.CharField(max_length=255, blank=True, null=True)
    file_path = models.CharField(max_length=255, blank=True, null=True)
    end_time = models.DateTimeField(blank=True, null=True)
    class Meta:
        db_table = 'tb_product_head'

class TbProductionmessage(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    m_no = models.CharField(max_length=40, blank=True, null=True)
    m_stat = models.CharField(max_length=40, blank=True, null=True)
    d_code = models.CharField(max_length=20, blank=True, null=True)
    me_no = models.IntegerField(blank=True, null=True)
    me_num = models.FloatField(blank=True, null=True)
    wheel_1 = models.CharField(max_length=45, blank=True, null=True)
    wheel_2 = models.CharField(max_length=45, blank=True, null=True)
    wheel_3 = models.CharField(max_length=45, blank=True, null=True)
    p_para = models.CharField(max_length=20, blank=True, null=True)
    op_id = models.CharField(max_length=20, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    op_time = models.DateTimeField(blank=True, null=True)
    t_no = models.CharField(max_length=40, blank=True, null=True)
    t_bmta = models.CharField(max_length=40, blank=True, null=True)
    t_rnot = models.FloatField(blank=True, null=True)
    t_ver = models.CharField(max_length=40, blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)
    head = models.ForeignKey(TbProductHead)
    mark_num = models.IntegerField(blank=True, null=True)
    uuid = models.CharField(max_length=255, blank=True, null=True)
    end_time = models.DateTimeField(blank=True, null=True)
    ap_num = models.IntegerField(blank=True, null=True)
    class Meta:
        db_table = 'tb_productionmessage'


class TbWheelmessage(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    w_no = models.CharField(max_length=20, blank=True, null=True)
    w_type = models.CharField(max_length=20, blank=True, null=True)
    w_gran = models.CharField(max_length=5, blank=True, null=True)
    w_speed = models.IntegerField(blank=True, null=True)
    w_feed = models.CharField(max_length=20, blank=True, null=True)
    desi_id = models.CharField(max_length=20, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    desi_time = models.DateTimeField(blank=True, null=True)
    m_type = models.CharField(max_length=20, blank=True, null=True)
    t_ver = models.CharField(max_length=20, blank=True, null=True)
    toolt = models.ForeignKey(TbDesignmessage)
    w_station = models.CharField(max_length=255, blank=True, null=True)
    class Meta:
        db_table = 'tb_wheelmessage'


class TbWheelSort(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    w_no = models.CharField(max_length=4, blank=True, null=True)
    m_no = models.CharField(max_length=20, blank=True, null=True)
    w_name = models.CharField(max_length=20, blank=True, null=True)
    w_ceme = models.CharField(max_length=10, blank=True, null=True)
    w_bran = models.CharField(max_length=10, blank=True, null=True)
    w_diam = models.FloatField(blank=True, null=True)
    w_arc = models.FloatField(blank=True, null=True)
    m_stat = models.CharField(max_length=20, blank=True, null=True)
    engi_id = models.CharField(max_length=20, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    update_time = models.DateTimeField(blank=True, null=True)
    t_ver = models.CharField(max_length=4, blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)
    w_rnot1 = models.FloatField(blank=True, null=True)
    w_rnot2 = models.FloatField(blank=True, null=True)
    w_gran = models.CharField(max_length=20, blank=True, null=True)
    toolt = models.ForeignKey(TbDesignmessage)
    mark_num = models.IntegerField(blank=True, null=True)
    uuid= models.CharField(max_length=255, blank=True, null=True)
    file_path0 = models.CharField(max_length=255, blank=True, null=True)
    end_time = models.DateTimeField(blank=True, null=True)
    w_station = models.CharField(max_length=255, blank=True, null=True)
    class Meta:
        db_table = 'tb_wheel_sort'

class TbAblation(models.Model):
    t_name = models.CharField(max_length=40, blank=True, null=True)
    t_ver = models.CharField(max_length=4, blank=True, null=True)
    m_no = models.CharField(max_length=20, blank=True, null=True)
    m_stat = models.CharField(max_length=10, blank=True, null=True)
    update_time = models.DateTimeField(blank=True, null=True)
    engi_id = models.CharField(max_length=20, blank=True, null=True)
    last_name = models.CharField(max_length=20, blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)
    w_bala = models.FloatField(blank=True, null=True)
    w_speed = models.FloatField(blank=True, null=True)
    w_feed = models.FloatField(blank=True, null=True)
    toolt = models.ForeignKey(TbDesignmessage)
    wsort = models.ForeignKey(TbWheelSort)
    end_time = models.DateTimeField(blank=True, null=True)
    ap_num = models.IntegerField(blank=True, null=True)
    class Meta:
        db_table = 'tb_ablation'


class TbGrindngsite(models.Model):
    modelcode = models.CharField(max_length=5, blank=True, null=True)
    site = models.CharField(max_length=30, blank=True, null=True)
    sitenum = models.CharField(max_length=5, blank=True, null=True)

    class Meta:
        db_table = 'tb_grindngsite'



class TbCorrections(models.Model):
    modelcode = models.CharField(max_length=5, blank=True, null=True)
    site = models.CharField(max_length=30, blank=True, null=True)
    sitenum = models.CharField(max_length=5, blank=True, null=True)
    drcorrection = models.CharField(max_length=30, blank=True, null=True)
    correctionname = models.CharField(max_length=30, blank=True, null=True)
    correctioncode = models.CharField(max_length=30, blank=True, null=True)

    class Meta:
        db_table = 'tb_corrections'


class TbMachineCode(models.Model):
    m_type = models.CharField(max_length=20)
    m_code = models.CharField(max_length=4)

    class Meta:
        db_table = 'tb_machine_code'


class TbBrand(models.Model):
    w_brand = models.CharField(max_length=20, blank=True, null=True)

    class Meta:
        db_table = 'tb_brand'





